<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./data.js"></script>
    <script>
        // 
        // i = 0  少0次
        // i =1   少1次
        for(var i=0;i<clothes.length-1;i++){
            for(var j=0;j<clothes.length-1-i;j++){
                if(clothes[j]['sales']<clothes[j+1]['sales']){
                    var temp = clothes[j];
                    clothes[j] = clothes[j+1];
                    clothes[j+1] = temp;
                }
            }
        }

        console.log(clothes)
    </script>
</body>
</html>